package pl.edu.pk.mech.kkbus.model;

import static pl.edu.pk.mech.kkbus.staticstrings.BusProperty.*;

import java.io.Serializable;
import java.util.Date;

import com.google.appengine.api.datastore.Entity;

public class Bus extends Pojo implements Serializable{

	private static final long serialVersionUID = 4722317005501657128L;
	private String brand;
	private String description;
	private int numSittingPlace;
	private Date productionYear;
	private String registartion;
	private String status;
	private String parking;
	
	public Bus(){
	}

    public Bus(long id, String brand, String description, int numSittingPlace, Date productionYear, String registartion, String parking) {
        super(id);
        this.brand = brand;
        this.description = description;
        this.numSittingPlace = numSittingPlace;
        this.productionYear = productionYear;
        this.registartion = registartion;
        this.parking = parking;
    }
	
        
	public Bus(Entity entity){
		this.id = entity.getKey().getId();
		this.brand = (String) entity.getProperty(BUSSES_BRAND);
		this.description = (String) entity.getProperty(BUSSES_DESC);
		this.numSittingPlace = Integer.valueOf(entity.getProperty(BUSSES_NUMB_PLACE).toString());
		this.productionYear = (Date) entity.getProperty(BUSSES_PRODUCTION_YEAR);
		this.registartion = (String) entity.getProperty(BUSSES_REGISTRATION);
		this.status = (String) entity.getProperty(BUSSES_STATUS);
		this.parking = (String) entity.getProperty(BUSSES_PARKING);
	}
	
	public int getNumSittingPlace() {
		return numSittingPlace;
	}

	public void setNumSittingPlace(int numSittingPlace) {
		this.numSittingPlace = numSittingPlace;
	}

	public Date getProductionYear() {
		return productionYear;
	}

	public void setProductionYear(Date productionYear) {
		this.productionYear = productionYear;
	}

	public String getRegistartion() {
		return registartion;
	}

	public void setRegistartion(String registartion) {
		this.registartion = registartion;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	public String getBrand() {
		return brand;
	}

	public long getId() {
		return id;
	}

	public void setBrand(String name) {
		this.brand = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getParking() {
		return parking;
	}

	public void setParking(String parking) {
		this.parking = parking;
	}
}
